package jd.cn.service.impl;

import jd.cn.dao.sysRole.SysRoleMapper;
import jd.cn.pojo.SysRole;
import jd.cn.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service("sysRoleService")
public class SysRoleServiceImpl implements SysRoleService {


    @Autowired
    private SysRoleMapper sysRoleMapper;

    /**
     * 根据角色名称模糊查询
     *
     * @param sysRole
     * @return
     */
    @Override
    public List<SysRole> selectRoleList(SysRole sysRole) {
        return sysRoleMapper.selectRoleList(sysRole);
    }

    /**
     * 添加角色
     *
     * @param role
     * @return
     */
    @Override
    public boolean addRole(SysRole role) {
        if(sysRoleMapper.addRole(role)==1){
            return true;
        }else {
            return false;
        }
    }


}
